// 常量路由 任何角色都可以访问的
import Home from '@/views/Home.vue' 
import Login from '@/views/login/index.vue'
const user = () => import('@/views/acl/user/index.vue')
const role = () => import('@/views/acl/role/index.vue')
const homedemo = () => import('@/views/home/index.vue')
const screen = () => import('@/views/screen/screen.vue')
export const constantRoutes = [
    {
        path: '/',
        // name: '',
        component: Home,
        redirect:'/home',
        children:[
          {
            path:'home',
            name:'首页',
            component:homedemo
          },
        
          {
            path:'user',
            name:'user',
            component:user
          },
    {
      path:'role',
      name:'role',
      component:role
    }
        ],
    
      },
      {
        path:'/login',
        name:'login',
        component:Login
      },
      {
        path:'/screen',
        name:'screen',
        component:Home,
        meta:{
          title: '数据大屏',
          hidden: false,
          icon: 'Lock',
        },
        children:[
          {
            path:'/screen/screen',
            name:'screen',
            component:()=>import('@/views/screen/index.vue'),
            meta:{
              title:'大屏'
            }
          }
        ]
      },
      
    {
        path: '/acl',
        name: 'Acl',
        component:Home,
        redirect: '/acl/user',
        meta: {
          title: '权限管理',
          hidden: false,
          icon: 'custom-icon-mima',
        },
        children: [
          {
            path: '/acl/user',
            name: 'User',
            component: () => import('@/views/acl/user/index.vue'),
            meta: {
              title: '用户管理',
              hidden: false,
              icon: 'custom-icon-yonghu',
            },
          },
          {
            path: '/acl/role',
            name: 'Role',
            component: () => import('@/views/acl/role/index.vue'),
            meta: {
              title: '角色管理',
              hidden: false,
              icon: 'custom-icon-wode',
            },
          },
          {
            path: '/acl/permission',
            name: 'Permission',
            component: () => import('@/views/acl/permission/index.vue'),
            meta: {
              title: '菜单管理',
              hidden: false,
              icon: 'custom-icon-fenlei',
            },
          },
        ],
      },
      {
        path: '/product',
        name: 'Product',
        component: Home,
        redirect: '/product/trademark',
        meta: {
          title: '商品管理',
          hidden: false,
          icon: 'custom-icon-shangpinguanli',
        },
        children: [
          {
            path: '/product/trademark',
            name: 'Trademark',
            component: () => import('@/views/product/trademark/index.vue'),
            meta: {
              title: '品牌管理',
              hidden: false,
              icon: 'custom-icon-fenlei',
            },
          },
          {
            path: '/product/attr',
            name: 'Attr',
            component: () => import('@/views/product/attr/index.vue'),
            meta: {
              title: '属性管理',
              hidden: false,
              icon: 'custom-icon-fenlei',
            },
          },
          {
            path: '/product/spu',
            name: 'Spu',
            component: () => import('@/views/product/spu/index.vue'),
            meta: {
              title: 'SPU管理',
              hidden: false,
              icon: 'custom-icon-fenlei',
            },
          },
          {
            path: '/product/sku',
            name: 'Sku',
            component: () => import('@/views/product/sku/index.vue'),
            meta: {
              title: 'SKU管理',
              hidden: false,
              icon: 'custom-icon-fenlei',
            },
          },
        ],
      },
     
 
    {
      path: '/earth',
      name: 'earth',
      component:screen
    },
    {
      path: '/404',
      name: '404',
      component: () => import('@/views/404.vue'),
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'Any',
      redirect: '/404',
    }
]
// // 异步路由
// export const asyncRoutes = [
//   {
//     path: '/acl',
//     name: 'Acl',
//     component: () => import('@/layout/index.vue'),
//     redirect: '/acl/user',
//     meta: {
//       title: '权限管理',
//       hidden: false,
//       icon: 'Lock',
//     },
//     children: [
//       {
//         path: '/acl/user',
//         name: 'User',
//         component: () => import('@/views/acl/user/index.vue'),
//         meta: {
//           title: '用户管理',
//           hidden: false,
//           icon: 'User',
//         },
//       },
//       {
//         path: '/acl/role',
//         name: 'Role',
//         component: () => import('@/views/acl/role/index.vue'),
//         meta: {
//           title: '角色管理',
//           hidden: false,
//           icon: 'UserFilled',
//         },
//       },
//       {
//         path: '/acl/permission',
//         name: 'Permission',
//         component: () => import('@/views/acl/permission/index.vue'),
//         meta: {
//           title: '菜单管理',
//           hidden: false,
//           icon: 'Grid',
//         },
//       },
//     ],
//   },
//   {
//     path: '/product',
//     name: 'Product',
//     component: () => import('@/layout/index.vue'),
//     redirect: '/product/trademark',
//     meta: {
//       title: '商品管理',
//       hidden: false,
//       icon: 'Goods',
//     },
//     children: [
//       {
//         path: '/product/trademark',
//         name: 'Trademark',
//         component: () => import('@/views/product/trademark/index.vue'),
//         meta: {
//           title: '品牌管理',
//           hidden: false,
//           icon: 'ShoppingCart',
//         },
//       },
//       {
//         path: '/product/attr',
//         name: 'Attr',
//         component: () => import('@/views/product/attr/index.vue'),
//         meta: {
//           title: '属性管理',
//           hidden: false,
//           icon: 'ShoppingBag',
//         },
//       },
//       {
//         path: '/product/spu',
//         name: 'Spu',
//         component: () => import('@/views/product/spu/index.vue'),
//         meta: {
//           title: 'SPU管理',
//           hidden: false,
//           icon: 'Grid',
//         },
//       },
//       {
//         path: '/product/sku',
//         name: 'Sku',
//         component: () => import('@/views/product/sku/index.vue'),
//         meta: {
//           title: 'SKU管理',
//           hidden: false,
//           icon: 'Grid',
//         },
//       },
//     ],
//   }
// ]


